package com.wanmei.service;

import com.wanmei.mapper.RoleMapper;
import com.wanmei.pojo.Role;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("RoleService")
public class RoleService {
    @Autowired
    private RoleMapper roleMapper;

    /**
     * 通过User获取的roleID来寻找角色权限名
     * @param roleId
     * @return
     */
    public Role getRoleByRoleId(int roleId){
        return roleMapper.getRoleByRoleId(roleId);
    }

    public List<Role> getAllRoles(){
        return  roleMapper.getAllRole();
    }
}
